package de.slothsoft.commons.res;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class CommonMessages {

    private static String BUNDLE_NAME = "de.slothsoft.commons.res.common"; //$NON-NLS-1$
    private static ResourceBundle bundle;

    static {
	try {
	    bundle = ResourceBundle.getBundle(BUNDLE_NAME);
	} catch (MissingResourceException e) {
	    // the resource bundle cannot be found
	    System.err.println(e.getMessage());
	}
    }

    public static String getString(String key) {
	try {
	    return bundle.getString(key);
	} catch (MissingResourceException e) {
	    return "!" + key + "!";//$NON-NLS-1$//$NON-NLS-2$
	}
    }

}
